//柠檬水找零
https://leetcode.cn/problems/lemonade-change/description/
class Solution {
public:
    bool lemonadeChange(vector<int>& bills) 
    {
        int five_num = 0;
        int ten_num = 0;
        for(auto e: bills)
        {
            if(e == 5)
            {
                five_num++;
            }
            else if(e == 10)
            {
                if(five_num == 0)
                {
                    return false;
                }
                else 
                {
                    five_num--;
                    ten_num++;
                }
            }
            else
            {
                //20
                if(ten_num >= 1 && five_num >= 1)
                {
                    ten_num--;
                    five_num--;
                }
                else if(five_num >= 3)
                {
                    five_num -= 3;
                }
                else
                {
                    return false;
                }
            }
        }
        return true;
    }
};